<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>		
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑角色</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../css/pop-page.css" />
<script type="text/javascript" src="../easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../js/win.js"></script>
<script type="text/javascript">
	function initForm(){
		$('#fm').form({
			url : '../role/editRole.do',  
		    onSubmit: function(){
		    	var name = $("#name").val();
		    	if($.trim(name) == ""){
		    		$.messager.alert("提示", "&nbsp;&nbsp;<br/>请输入名称!", "info");
			    	return false;
		    	}
		    	return true;
		    },  
		    success:function(msg){
		        if("success" == msg){
		        	parent.reloadDg();
		        } else {
		        	$.messager.alert('Warning','<br />' + msg);
		        }
		    }
		});
	}
	
	$(function(){
		initForm();
	});

</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'center',border:false">
		<form id="fm" method="post">
			<s:if test="role != null">
				<input type="hidden" value='<s:property value="role.id"/>' name='role.id'>
			</s:if>
			<table style="margin-top: 30px" cellspacing="10px">
				<tr>
					<td align="right" style="padding-right: 5px;width: 30%">名称</td>
					<td>
						<input type='text' id="name" name="role.name" 
							class='in-text' value='<s:property value="role.name"/>'/>
						<font color="red">&nbsp;*</font>
					</td>
				</tr>
				<tr>
					<td align="right" style="padding-right: 5px;width: 30%">类型</td>
					<td>
						<select class="easyui-combobox" name="role.scope" 
							data-options="panelHeight: 'auto'" style="width: 150px">
							<option value="1" <s:if test="role.scope == 1">selected</s:if>>所有人员</option>
							<option value="2" <s:if test="role.scope == 2">selected</s:if>>指定人员</option>
						</select>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div data-options="region:'south'" class='fm-btn'>
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="$('#fm').submit();">确定</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="parent.closeWin()">取消</a>
	</div>
</body>
</html>